package com.huangliusong.hlsinspringboot.bootstrap;

import com.huangliusong.hlsinspringboot.annotation.EnableHelloWorld;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

@EnableHelloWorld
public class EnableHelloWorldBootStrap {
    public static void main(String[] args){
        ConfigurableApplicationContext context=new SpringApplicationBuilder(EnableHelloWorldBootStrap.class)
                .web(WebApplicationType.NONE)
                .run(args);

        //HelloWordlBean是否存在
        String helloWorld=context.getBean("helloWorld",String.class);
        System.out.println(helloWorld);

        context.close();
    }
}
